# -*- coding: utf-8 -*-
import pygame
pygame.init()
from sys import exit
from pygame.locals import *

position = Rect(200, 250, 150, 40)
position.inflate_ip(20,20)
outline = position.inflate(5,5)
showMenu = True

def quit():
	pressed_keys = pygame.key.get_pressed()
	if pressed_keys[K_ESCAPE]:
		exit()

def user_click(event):
	global showMenu
	x, y = pygame.mouse.get_pos()
	if (event.type == MOUSEBUTTONDOWN) and (position.collidepoint(x,y) == True):
		showMenu = False


def main_menu(screen):

	font = pygame.font.SysFont("arial", 30)
	title_font = pygame.font.SysFont("arial", 70)
	
	global showMenu
	while showMenu == True:
		event = pygame.event.poll()
		if event.type == QUIT:
			exit()
		quit()
		user_click(event)
		screen.fill((0, 0, 0))
		pygame.draw.rect(screen,(255,0,0),outline)
		pygame.draw.rect(screen,(0,0,0),position)
		screen.blit(title_font.render("CRITTER BALL", True, (255, 255, 255)), (45, 10) )
		screen.blit(font.render("New Game", True, (255, 255, 255)), (200, 250) )
		pygame.display.update()
